// Oliver Shyal Beardsley
// 18/2/2011

//! Common class declaration

#ifndef _COMMON_H_
#define _COMMON_H_

#include <string>
#include <vector>
#include <QString>
#include <QThread>

#include "Deck.h"
#include "treeitem.h"

const int MINUTES_IN_1_HOUR = 60;
const int HOURS_IN_1_DAY = 24;
const int DAYS_IN_1_MONTH = 30;
const int MONTHS_IN_1_YEAR = 12;

const int SECONDS_IN_1_MINUTE = 60;
const int SECONDS_IN_1_HOUR = MINUTES_IN_1_HOUR * SECONDS_IN_1_MINUTE;
const int SECONDS_IN_1_DAY = SECONDS_IN_1_HOUR * HOURS_IN_1_DAY;
const int SECONDS_IN_1_MONTH = SECONDS_IN_1_DAY * DAYS_IN_1_MONTH;
const int SECONDS_IN_1_YEAR = SECONDS_IN_1_MONTH * MONTHS_IN_1_YEAR;

std::string 	intToString(int i);
std::string 	floatToString(float f);
void 			Tokenize(const std::string& str,
						 std::vector<std::string>& tokens,
						 const std::string& delimiters);

QString getHome();
QString getTFCUserDir();
QString getTFCMediaDir(QString depthpath);
QString getTFCGeneratedAudioDir(QString depthpath);
QString getUserName();

class QThreadEx : public QThread
{
	protected:
		void							run();
};

class Settings
{
	public:
		//static bool					m_requestLeaf; //removed because made the code non re-interable. Factory pattern is use instead
		static TreeItem*				m_buffer;
};

QString sysExec(const char* cmd);

#endif
